<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@ taglib uri="/WEB-INF/tlds/c.tld" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
    <title>修改俱乐部</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <%-- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/theme/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/theme/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/theme/style.css" /> --%>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/theme/jquery.js"></script>
    <%-- <script type="text/javascript" src="${pageContext.request.contextPath}/js/theme/bootstrap.js"></script> --%>
   <%--  <script type="text/javascript" src="${pageContext.request.contextPath}/js/theme/ckform.js"></script> --%>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/theme/common.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/layerui/layer.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/layerui/layer.ext.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/common/checkFormat.js"></script>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/skin/css/mobilecss/charge.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/skin/css/mobilecss/main.css">

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }
		.container span {
			display: inline-block;
			 border:none;
			 padding: 0.5rem;
			 width:16%;
			 text-align: right;
		}

    </style>
</head>
<body>

<div class="container">
        <p style="font-size: 0.9rem" id="addTitle">修改</p>
        <div style="border: 1px solid #636363">
            <span style="border:none;padding: 0.5rem;">名称</span>
            <input type="text" id="crowdName" name="crowdName" maxlength="15" value="${crowd.crowdName}" placeholder="例如：亲友娱乐俱乐部" style="border: none;width: 60%;background-color: #FFFFFF">
        </div>
        <div style="border: 1px solid #636363">
            <span style="border:none;padding: 0.5rem;" >备注</span>
            <input type="text" id="remark" name="remark" maxlength="100" value="${crowd.remark}" style="border: none;width: 60%"> 
        </div>
        <div style="margin-top: 3rem">
            <button style="width: 100%" id="usersave" >确认修改</button>
        </div>
    </div>
    
   
</body>
<script>
    $(function () {       
		$('#backid').click(function(){
			var system ={}; 
	        var p = navigator.platform;      
	        system.win = p.indexOf("Win") == 0; 
	        system.mac = p.indexOf("Mac") == 0; 
	        system.x11 = (p == "X11") || (p.indexOf("Linux") == 0);    
	        if(system.win||system.mac||system.xll){
	    		//如果是电脑跳转到弹出框 
	        	parent.layer.close(parent.lindex);
	        }else{  
	    		//如果是手机,跳转到页签
	    		window.location.href="${pageContext.request.contextPath}/admin/user_next_info.html";
	        }
		 });

		
		$('#usersave').click(function(){
			var crowdName = $("#crowdName").val();
			var remark =$("#remark").val();
			if(crowdName==""){
				layer.alert("请填写俱乐部名称");
				return;
			}
			if(crowdName.length>9){
				layer.alert("名字长度超出，请删减" + (crowdName.length-9) + "个字");
				return;
			}
			if(crowdName.indexOf("元")!=-1||crowdName.indexOf("角")!=-1||crowdName.indexOf("圆")!=-1||crowdName.indexOf("块")!=-1||
					crowdName.indexOf("毛")!=-1||crowdName.indexOf("赌")!=-1||crowdName.indexOf("发财")!=-1||crowdName.indexOf("赢钱")!=-1){
				layer.alert("不能包含“元  角  圆  块 毛  赌  发财  赢钱”等涉赌字样~");
				return;
			}
			$('#usersave').attr('disabled',"true"); //添加disabled属性 
			$.post("${pageContext.request.contextPath}/wechat/crowd_edit_save.html",
		            {"crowdId":'${crowd.id}',"crowdName":crowdName,"remark":remark},
		       function(data){
		            	var json = eval("("+data+")");
						layer.alert(json.message);
						if(json.statusCode =='200'){
							$('#usersave').removeAttr("disabled");
							setTimeout("addAgentCancel()",2000);
						}
		      });
			
		 });
    });
  
    function addAgentCancel() {
	    $("#myalert").css("display","none");
	    window.location.href="${pageContext.request.contextPath}/wechat/crowd_my.html";
    }
    
    
    
</script>
</html>